package interpreter;

public class Client {
    public static void main(String[] args) {
        Expression select = new TerminalExpression("Select");
        Expression from = new TerminalExpression("From");
        Expression isSelectFrom = new AndExpression(select, from);

        Expression insert = new TerminalExpression("Insert");
        Expression update = new TerminalExpression("Update");
        Expression isInsertOrUpdate = new OrExpression(insert, update);

        System.out.println(isSelectFrom.interpret("Select"));
        System.out.println(isInsertOrUpdate.interpret("Insert"));

        System.out.println(isSelectFrom.interpret("Select From"));
        System.out.println(isInsertOrUpdate.interpret("Update"));
    }
}
